package bigNumbers;

import java.util.ArrayList;

public class TestNumber
{

	/**
	 * @param args
	 * @throws Exception
	 */
	public static void main(String[] args) throws Exception
	{
		String anum = "0";
		String bnum = "0.01";
		String cnum = "12345.6789";

		// String cnum="00000012345.6780000";
		// Number c = new Number("c",cnum);
		// System.out.println(c);
		// c=c.clearZero();
		// System.out.println(c);

		Number a = new Number("a", anum);
		Number b = new Number("b", bnum);

		System.out.println(a);
		System.out.println(b);
		String sign = "=";
		int compare = Number.isMinor(a, b);
		if (compare == 1)
			sign = ">";
		if (compare == -1)
			sign = "<";

		System.out.println("a " + sign + " b ");
		System.out.println(a + " " + sign + " " + b);
		//
		// System.out.println("\nAlign:");
		// b = a.align(b);
		// System.out.println(a);
		// System.out.println(b);

		Number sum = Number.add(a, b);
		System.out.println("sum");
		System.out.println(sum);

		Number c = new Number("c", anum);
		Number d = new Number("d", bnum);

		Number sub = Number.subtract(c, d);
		System.out.println("subtract");
		System.out.println(sub);

		for (int i = 0; i < 10; i++)
		{
			Number cc = new Number("cc", cnum);
			System.out.println(cc);
			Number dd = cc.multiply10(i);
			System.out.println(dd);
		}
		Number cc = new Number("cc", anum);
		System.out.println(cc);

		ArrayList<Integer> aaa = new ArrayList<Integer>();
		ArrayList<Integer> ccc = new ArrayList<Integer>();
		
		aaa.add(111);
		aaa.add(222);
		aaa.add(333);
		
		ccc.add(111);
		ccc.add(222);
		ccc.add(333);
		ccc.add(444);
		ArrayList<Integer> bbb = Number.addArrays(aaa, ccc);
		System.out.println("bbb:"+bbb);
		
		aaa = new ArrayList<Integer>();
		ccc = new ArrayList<Integer>();
		aaa.add(9);
		aaa.add(9);
		aaa.add(9);
		
		ccc.add(1);
		ccc.add(1);
		ccc.add(1);
		ccc.add(1);
		
		ArrayList<Integer> ddd = Number.subtractArrays(ccc,aaa);
		System.out.println("ddd:"+ddd);
		
		
		System.out.println("bbb:"+bbb);

		bnum = "222222";
		cnum = "-34.0";
		anum = "1.000125";
		a = new Number("a", cnum);
		b = new Number("b", anum);
		System.out.println(a);
		System.out.println(b);
		Number n = Number.multiply(a, b);
		System.out.println(n.clearZero());

		anum="5731405";
		bnum="432";
		a = new Number("a", anum);
		b = new Number("b", bnum);
		int decimals =9;
		Number res = Number.divide(a,b, decimals);
		System.out.println(res.clearZero());
	}

}
